{
    rules+: [
         {
            // 容器消失
            alert: 'ContainerKilled',
            annotations: {
                message: 'A container has disappeared 消失容器: {{ $value }}  告警主机: {{ $labels.instance }}.',
                summary: '容器丢失 (instance {{ $labels.instance }})',
                runbook: $._config.runbook,
            },
            expr: |||
              time() - container_last_seen > 60
            |||,
            'for': '0m',
            labels: {
                severity: 'warning'
            },
        },
        {
            // 容器CPU使用率超过80%。
            alert: 'ContainerCpuUsage',
            annotations: {
                message: '容器CPU使用率高于 80%  当前值 = {{ $value }}  告警主机: {{ $labels.instance }}.',
                summary: 'Host CPU steal noisy neighbor (instance {{ $labels.instance }})',
                runbook: $._config.runbook,
            },
            expr: |||
              (sum(rate(container_cpu_usage_seconds_total[3m])) BY (instance, name) * 100) > 80
            |||,
            'for': '2m',
            labels: {
                severity: 'warning'
            },
        },
        {
            // 容器内存使用率超过80%。
            alert: 'ContainerMemoryUsage',
            annotations: {
                message: '容器内存使用率高于 80%  当前值 = {{ $value }}  告警主机: {{ $labels.instance }}.',
                summary: 'Container Memory usage (instance {{ $labels.instance }})',
                runbook: $._config.runbook,
            },
            expr: |||
              (sum(container_memory_working_set_bytes) BY (instance, name) / sum(container_spec_memory_limit_bytes > 0) BY (instance, name) * 100) > 80
            |||,
            'for': '2m',
            labels: {
                severity: 'warning'
            },
        },
        {
            // 容器IO使用率超过80%。
            alert: 'ContainerVolumeIoUsage',
            annotations: {
                message: '容器IO使用率高于 80%  当前值 = {{ $value }}  告警主机: {{ $labels.instance }}.',
                summary: 'Container Volume IO usage (instance {{ $labels.instance }})',
                runbook: $._config.runbook,
            },
            expr: |||
              (sum(container_fs_io_current) BY (instance, name) * 100) > 80
            |||,
            'for': '2m',
            labels: {
                severity: 'warning'
            },
        },
    ],
}
